package com.example.zbh.dsliao.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.example.zbh.dsliao.R;
import com.example.zbh.dsliao.ui.activty.LocalActivity;

/**
 * Created by yaolin on 15/11/19.
 */
public class MyMusicFragment extends BaseFragment implements View.OnClickListener{
        private ImageView anim_img;
        private LinearLayout local_layout, music_library_layout;

        @Nullable
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View v = inflater.inflate(R.layout.fragment_my_music, null);
            return v;
        }

        @Override
        public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
            super.onViewCreated(view, savedInstanceState);
            anim_img = (ImageView) view.findViewById(R.id.anim_img);
            local_layout = (LinearLayout) view.findViewById(R.id.local_layout);
            local_layout.setOnClickListener(this);
            music_library_layout = (LinearLayout) view.findViewById(R.id.music_library_layout);
            music_library_layout.setOnClickListener(this);
        }



    @Override
    protected void initData() {

        Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.my_background);
        anim_img.setAnimation(animation);

    }

    @Override
        public void onClick(View v) {
            switch (v.getId()){
                case R.id.local_layout:
                    Intent intent = new Intent(getContext(), LocalActivity.class);
                    startActivity(intent);
                    break;
                case R.id.music_library_layout:
                    break;
            }

        }
    }
